[

	
	var('sponsor_type' = 'site');
	var('bilboard' = string);
	var('sponsor' = string);
	
	
	inline(
		$connection_db,
		-sql=('
			SELECT g.UID AS Sponsor_UID 
			FROM Pages__Gold_Club_Members AS this 
			LEFT JOIN Gold_Club_Members AS g ON this.Gold_Club_Members_UID = g.UID 
			WHERE this.Pages_id = '+$pageID
			),
		-table='Pages',
		);
			//$public_content += action_statement;
		
			if(error_msg != 'No Error');
			else;
					found_count == 1 ? $sponsor_type = 'page';
					rows;
						var('Sponsor_UID' = column('Sponsor_UID'));
					/rows;
					var('sponsor_uid') >> '0000000000000' || var('sponsor_uid') == '' ? $sponsor_type = 'site';
			/if;
	/inline;




	if($sponsor_type == 'site');
			inline($connection_db, -sql='SELECT Gold_Club_Members_UID AS sponsor_uid FROM Site_Sponsor WHERE UID IS NOT NULL');
					//$public_content += action_statement;
					//$public_content += '<p class="">'found_count'</p>';
					if(found_count == 0);
					else;
							rows;
									var('Sponsor_UID' = column('sponsor_uid'));
							/rows;
					/if;
			/inline;
			
			//$public_content += '<p>sponsor_uid: ' $sponsor_uid'</p>';
			
			$sponsor_uid >> '0000000000000' || $sponsor_uid == '' ? ($sponsor_type = 'none');
	/if;




	if($sponsor_type != 'none');
			var('sponsors' = array);
			inline($connection_db, 
				-sql='
					SELECT Title, Keyword_URL, Bilboard_Image_URL 
					FROM Gold_Club_Members 
					WHERE Display_Status = "Show" 
					AND UID = "' $sponsor_uid '"
					LIMIT 1
					', 
				-inlinename='bilboards' 
				);
					//$public_content += action_statement;
					$sponsors=records_array;
					var('sponsors_count' = decimal(shown_count));
			/inline;
			
			
			
			rows(-inlinename='bilboards');
					$bilboard = '
					<a id="bilboard" href="/Gold_Club_Members/' column('Keyword_URL') '/">
							<img src="'+column('Bilboard_Image_URL')+'" border="0" width="158" height="52">
					</a>
					';
					$sponsor = '
					<a id="newssponsor" href="/Gold_Club_Members/' column('Keyword_URL') '/">
							Brought to you by <strong>' column('Title')'</strong>
					</a>
					';
					
			/rows;
			
		
			$bilboard;
	/if;


	//$public_content += $sponsor_type;



]
